﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            //链接字串符
            String tri = "server=.;database=school;uid=sa;pwd=123456";
            //声明对象
            SqlConnection conn = new SqlConnection(tri);
            //指令对象
            string sql = "insert into lll values(2, '199602', '男', '校长')";
            SqlCommand cmd = new SqlCommand(sql, conn);
            //打开链接
            conn.Open();
            //执行sql命令
            int a = cmd.ExecuteNonQuery();
            Console.WriteLine(a);
        }
    }
}
